package com.abel.bigwater.kmgw

import com.abel.bigwater.dataserver.model.ServiceConfig
import com.abel.bigwater.kmgw.dao.RtuDao
import com.abel.bigwater.mapper.DataMapper
import com.abel.bigwater.mapper.MeterMapper
import com.abel.bigwater.mapper.RtuMapper
import io.netty.channel.ChannelHandlerContext
import org.slf4j.LoggerFactory

class EwideServerUdpHandler(dataMapper: DataMapper?, meterMapper: MeterMapper?,
                            rtuMapper: RtuMapper?, rtuDao: RtuDao?, config: ServiceConfig) :
        EwideServerHandler(dataMapper, meterMapper, rtuMapper, rtuDao, config) {
    override fun exceptionCaught(ctx: ChannelHandlerContext?, cause: Throwable?) {
        lgr.error("fail to serve on udp: ${cause?.message}", cause)
    }

    companion object {
        private val lgr = LoggerFactory.getLogger(EwideServerUdpHandler::class.java)
    }
}